<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/taglibs.jsp"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <title>拨打电话</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctxLayui}/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxLayui}/layuiadmin/style/myStyle.css" media="all">
</head>
<body class="layui-layout-body">
<div class="layui-collapse">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">坐席信息</h2>
        <div class="layui-colla-content layui-show">
            <div class="layui-container">
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <label class="layui-form-label">呼叫电话：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid" id="div_mobile">18159166320</div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <label class="layui-form-label">坐席状态：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid" id="div_seatStatus">坐席空闲</div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <label class="layui-form-label">呼叫类型：</label>
                        <div class="layui-input-block">
                            <div class="layui-form-mid" id="div_callType">呼出</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-colla-item">
        <h2 class="layui-colla-title">客户信息</h2>
        <div class="layui-colla-content layui-show">
            <table class="layui-hide" id="callCustomerListTable" lay-filter="callCustomerListTable"></table>

            <script type="text/html" id="callCustomerListTable-bar">
                <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="showRec">查看</a>
            </script>
        </div>
    </div>

    <%--<div class="layui-colla-item">
        <h2 class="layui-colla-title">呼叫记录</h2>
        <div class="layui-colla-content layui-show">
            <div style="width: 100%;overflow-x: auto;">
                <table class="layui-hide" id="callRecordList" lay-filter="callRecordList"></table>
            </div>
        </div>
    </div>--%>

</div>
<%--<fieldset class="layui-elem-field">
    <legend>字段集区块 - 默认风格</legend>
    <div class="layui-field-box">
        内容区域
    </div>
</fieldset>

<fieldset class="layui-elem-field layui-field-title">
    <legend>字段集区块 - 横线风格</legend>
    <div class="layui-field-box">
        内容区域
    </div>
</fieldset>--%>

<script src="${ctxLayui}/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '${ctxLayui}/layuiadmin/'
    }).extend({
        index: 'lib/index'
    }).use(['index','table', 'form','dict','laytpl','util'], function(){
        var $ = layui.$ ,form = layui.form;
        var table = layui.table;
        var dict = layui.dict;
        var laytpl = layui.laytpl;
        var util = layui.util;
        var formData = window.parent.formData;

        $("#div_mobile").html(formData.mobile)
        $("#div_seatStatus").html(formData.seatStatus)
        $("#div_callType").html(formData.callType)

        var tplLastCallTime = function(d){
            if(d.modifyTime){
                return util.toDateString(d.modifyTime);
            }
            return '';
        };

        var tplLastVisitTime = function(d){
            if(d.modifyTime){
                return util.toDateString(d.modifyTime);
            }
            return '';
        };

        var tplTaxpayerType = function(d){
            var html = dict.showName("taxpayerType",d.taxpayerType);
            return html;
        };

        var customerTb = table.render({
            elem:'#callCustomerListTable'
            ,url: ctx+'/customer/customer/query'
            ,where:{mobile:formData.mobile}
            ,cellMinWidth: 80
//			,width:1400
            ,cols: [[
                {field:'name', title: '客户名称', align: 'center',width:150 }
                ,{field:'contacts', title: '联系人', align: 'center',minWidth:80 }
                ,{field:'mobile', title: '电话',event:'callMobile', align: 'center',minWidth:100 }
                ,{field:'intention', title: '意向分类', align: 'center',minWidth:80 }
                ,{field:'lastCallTime', title: '最后通话', align: 'center',minWidth:120,templet:tplLastCallTime }
                ,{field:'lastVisitTime', title: '最后拜访', align: 'center',minWidth:120,templet:tplLastVisitTime }
                ,{field:'taxpayerType', title: '纳税人类型', align: 'center',minWidth:80,templet:tplTaxpayerType }
                ,{title:'操作', toolbar: '#callCustomerListTable-bar', width:120}
            ]]
            ,limit: 10
            ,limits: layui.setter.limits,
        });

    })
</script>
</body>
</html>
